package jk.fox.config.exchange.standard;

import jk.fox.config.RpcConfiguration;
import jk.fox.config.exchange.ExchangeConfiguration;
import jk.fox.config.exchange.ExchangeConfigurationBuilder;

/**
 * @author cuichao
 * @Description: DefaultExchangeConfigurationBuilder
 * @Date: create in 2020/6/3 23:29
 */
public class DefaultExchangeConfigurationBuilder extends ExchangeConfigurationBuilder {

    private DefaultExchangeConfiguration configuration;

    public DefaultExchangeConfigurationBuilder(RpcConfiguration.RpcConfigBuilder builder) {
        super(builder);
        this.configuration = new DefaultExchangeConfiguration();
    }


    public DefaultExchangeConfigurationBuilder connectMaxRetries(int connectMaxRetries){
        configuration.setConnectMaxRetries(connectMaxRetries);
        return this;
    }

    public DefaultExchangeConfigurationBuilder connectRetryIntervalMS(long connectRetryIntervalMS){
        configuration.setConnectRetryIntervalMS(connectRetryIntervalMS);
        return this;
    }



    @Override
    public ExchangeConfiguration build() {
        return configuration;
    }
}
